//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//// PARTICULAR PURPOSE.
////
//// Copyright (c) Microsoft Corporation. All rights reserved.

//namespace Microsoft.Samples.Commerce.Order.CommerceEntities
//{
//    using Microsoft.Commerce.Contracts;

//    /// <summary>
//    /// Representation of a product from the product catalog
//    /// </summary>
//    /// <remarks>
//    /// Here is more information on how to
//    /// <a href="../AdditionalContent/Development/Create/CreateBuilderProduct.htm">Create Products</a><br/>
//    /// </remarks>
//    public class Product : HierarchicalCatalogEntity
//    {
//        #region Constructors

//        /// <summary>
//        /// defines the model name for this commerce entity
//        /// </summary>
//        public new const string ModelNameDefinition = "Product";

//        /// <summary>
//        /// Initializes a new instance of the <see cref="Product"/> class.
//        /// </summary>
//        public Product()
//            : base()
//        {
//            this.CommerceEntity = new CommerceEntity(Product.ModelNameDefinition);
//        }

//        /// <summary>
//        /// Initializes a new instance of the <see cref="Product"/> class.
//        /// </summary>
//        /// <param name="commerceEntity">The commerce entity.</param>
//        public Product(CommerceEntity commerceEntity)
//            : base(commerceEntity)
//        {
//            this.CommerceEntity = commerceEntity;
//        }

//        #endregion

//        /// <summary>
//        /// Gets or sets the inventory condition.
//        /// </summary>
//        /// <value>The inventory condition.</value>
//        public int? InventoryCondition
//        {
//            get
//            {
//                return (int?)this.CommerceEntity.GetPropertyValue(PropertyName.InventoryCondition);
//            }

//            set
//            {
//                this.CommerceEntity.SetPropertyValue(PropertyName.InventoryCondition, value ?? null);
//            }
//        }

//        /// <summary>
//        /// Gets or sets the variant properties of the Product.
//        /// </summary>
//        /// <value>a list of Relationships where the target is of type Variant.</value>
//        /// <remarks>This is an optional property.</remarks>
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Collection setting is required")]
//        public CommerceRelationshipList Variants
//        {
//            get
//            {
//                return this.CommerceEntity.GetPropertyValue(RelationshipName.Variants) as CommerceRelationshipList;
//            }

//            set
//            {
//                this.CommerceEntity.SetPropertyValue(RelationshipName.Variants, value);
//            }
//        }

//        /// <summary>
//        /// Gets or sets the pricing category.
//        /// </summary>
//        /// <value>a CommerceRelationship where the target is of type Category.</value>
//        public CommerceRelationship PricingCategory
//        {
//            get
//            {
//                return this.CommerceEntity.GetPropertyValue(RelationshipName.PricingCategory) as CommerceRelationship;
//            }

//            set
//            {
//                this.CommerceEntity.SetPropertyValue(RelationshipName.PricingCategory, value);
//            }
//        }

//        /// <summary>
//        /// Gets or sets the inventory items.
//        /// </summary>
//        /// <value>a list of Relationships where the target is of type InventoryItem.</value>
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly", Justification = "Collection setting is required")]
//        public CommerceRelationshipList InventoryItems
//        {
//            get
//            {
//                return this.CommerceEntity.GetPropertyValue(RelationshipName.InventoryItems) as CommerceRelationshipList;
//            }

//            set
//            {
//                this.CommerceEntity.SetPropertyValue(RelationshipName.InventoryItems, value);
//            }
//        }

//        #region Implicit operators
//        /// <summary>
//        /// Toes the user profile.
//        /// </summary>
//        /// <param name="commerceEntity">The commerce entity.</param>
//        /// <returns></returns>
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2225:OperatorOverloadsHaveNamedAlternates", Justification = "Design decision for API")]
//        public static implicit operator Product(CommerceEntity commerceEntity)
//        {
//            System.Diagnostics.Debug.Assert(Product.ModelNameDefinition.Equals(commerceEntity.ModelName), "Unexpected model name");
//            return new Product(commerceEntity);
//        }
//        #endregion

//        /// <summary>
//        /// Names of the properties exposed by this commerce entity.
//        /// </summary>
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Needed for external access"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1053:StaticHolderTypesShouldNotHaveConstructors", Justification = "Cannot make it private as it cannot be derived from")]
//        public new class PropertyName : HierarchicalCatalogEntity.PropertyName
//        {
//            /// <summary>
//            /// The inventory condition of the product.
//            /// </summary>
//            public const string InventoryCondition = "InventoryCondition";
//        }

//        /// <summary>
//        /// Class defining Properties of Items that may be related to a Product.
//        /// </summary>
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", Justification = "Required because of API specification (i.e. DataContract design)")]
//        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1034:NestedTypesShouldNotBeVisible", Justification = "Needed for external access"), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1053:StaticHolderTypesShouldNotHaveConstructors", Justification = "Cannot make it private as it cannot be derived from")]
//        public new class RelationshipName : HierarchicalCatalogEntity.RelationshipName
//        {
//            /// <summary>
//            /// The name of the InventoryItems relationship.
//            /// </summary>
//            public const string InventoryItems = "InventoryItems";
            
//            /// <summary>
//            /// The name of the PricingCategory relationship.
//            /// </summary>
//            public const string PricingCategory = "PricingCategory";
            
//            /// <summary>
//            /// The name of the Variants relationship.
//            /// </summary>
//            public const string Variants = "Variants";
//        }
//    }
//}
